'''
@Owner dYrolign and DERFDY 2025.
@Author dYrolign.
@Contibutor iKeinsan, Werstog, Leoitsenn.
@DateCreated 2025/9/23.
'''

# I even specifically looked up how to spell this word, narcissistic. That's a fascinating name.
# The 'start' is for the starting number, such as 100.
# The 'end' is for the ending number.
# Thus, compared to the given instance, this generalized function can find far more narcissistic numbers.
# as long as you input specific arguments to it.
def narcissistic(start,end):
    narc_list = []
    for i in range(start, end):
        sum = 0 # I think this variable can be improved as optimization for the better usage of memory.
        for n in list(str(i)): sum += int(n)**len(list(str(i)))
        if sum == i: narc_list.append(sum)
    return narc_list

'''
# This is a generalization of the function above.
a = int(input("a:"))
b = int(input("b:"))
n = narcissistic(a,b)
'''
nlist = narcissistic(100,1000)
print(nlist)
